<template>
  <div class="user_right fl ml20">
    <div class="seller_Info">
      <img src="../../../assets/img/sellerImg.png" alt />
      <div class="user_profile">
        <div>
          {{storeInfo.company_name}}
          <img src="../../../assets/img/sellerLogo1.png" alt />
          <img src="../../../assets/img/sellerLogo2.png" alt />
        </div>
        <div>
          选择店铺：
          <el-select v-model="storeId" placeholder="请选择" @change="shopChoose">
            <el-option
              v-for="(item,index) in storeList"
              :key="index"
              :label="item.name"
              :value="index"
            ></el-option>
          </el-select>
        </div>
        <div>
          <div>
            <p>总销售额(月)</p>
            <p>{{priceInfo.month_order_count}}</p>
          </div>
          <div>
            <p>总订单数(月)</p>
            <p>{{priceInfo.month_total_amount}}</p>
          </div>
          <div>
            <p>总成交量</p>
            <p>{{priceInfo.total_amount}}</p>
          </div>
        </div>
      </div>
    </div>
    <div class="gap"></div>
    <div class="csas">
      <div class="seller_content">
        <div>我的店铺</div>
        <div>
          <div class="storeList" v-for="(item,index) in storeList" :key="index">
            <div>{{item.name}}</div>
            <div>{{item.user_name}}</div>
            <div>{{item.phone}}</div>
            <div>
              <router-link :to="`/sellerHome/?id=${item.id}`">进入店铺</router-link>
            </div>
          </div>
          <div class="storeBtn">
            <div>
              <router-link to="/selleru/apply_for">申请商铺</router-link>
            </div>
            <div>店铺状态</div>
          </div>
        </div>
      </div>
      <div class="help">
        <p>客服中心</p>
        <p>1,用户在申请店铺的过程中,如果有疑问,可随时拨打客服服务热线,进行咨询.</p>
        <p>2,店铺的使用方法,用户可通过点击"店铺操作流程",查看详细程序.</p>
        <div>
          <div>
            <p>后台咨询热线:</p>
            <p>400-610-0107</p>
          </div>
          <div>咨询</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { ovistoreList, businessInfo } from "@/api/business";
import { mapMutations } from 'vuex'
export default {
  name: "rt-detail",
  metaInfo: {
    title: "账户绑定",
    titleTemplate: "工流界MRO一站式采购商城",
  },
  data() {
    return {
      activeName: "first",
      hasMod: true,
      storeList: [],
      storeInfo: [],
      storeId:'',
      priceInfo:[]
    };
  },
  created() {
    this.getstoreList();
    this.getstoreInfo();
  },
  activated() {
    this.setHasNav(false)
  },
  methods: {
    
    handleClick(tab, event) {
      console.log(tab, event);
    },
    async getstoreList() {
      this.storeList = await ovistoreList();
      this.storeId = 0
      this.priceInfo = this.storeList[0]
    },
    async getstoreInfo() {
      this.storeInfo = await businessInfo();
    },

    shopChoose(e){
      this.priceInfo = this.storeList[e]
    }
  },
};
</script>

<style lang="scss" scoped>
.seller_Info {
  width: 710px;
  height: 190px;
  background-color: #fff;
  display: flex;
  align-items: center;
  > img {
    width: 123px;
    height: 128px;
    background-color: #fff;
    margin-left: 20px;
  }
}
.user_profile {
  margin-left: 33px;
  > div {
    &:nth-child(1) {
      font-size: 24px;
      color: #333;
      img {
        margin-left: 5px;
      }
    }
    &:nth-child(2){
      margin-top: 20px;
    }
    &:nth-child(3) {
      display: flex;
      div {
        flex: 1;
        width: 150px;
        height: 65px;
        background: #999;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-flow: column;
        margin-right: 20px;
        border-radius: 5px;
        margin-top: 20px;
        > p {
          &:nth-child(1) {
            font-size: 16px;
            color: #666;
          }
          &:nth-child(2) {
            font-size: 16px;
            color: #ff0000;
            margin-top: 10px;
          }
        }
      }
    }
  }
}
.seller_content {
  width: 710px;
  background-color: #fff;
  margin-top: 15px;
  > div {
    &:nth-child(1) {
      font-size: 18px;
      color: #4448f8;
      font-weight: 600;
      padding-top: 25px;
      padding-left: 45px;
    }
    &:nth-child(2),
    &:nth-child(3) {
      margin-top: 25px;
      padding-left: 45px;
      padding-bottom: 40px;
      border-bottom: 2px dashed #bfbfbf;
      > p {
        font-size: 18px;
        color: #666;
        font-weight: 600;
      }
      > div {
        display: flex;
        margin-top: 25px;
        margin-left: 100px;
        > div {
          font-size: 16px;
          color: #666;
          font-weight: 600;
          margin-right: 40px;
          > span {
            &:nth-child(2) {
              color: #ff0000;
              margin-left: 5px;
            }
          }
        }
      }
    }
    &:nth-child(3) {
      border: 0;
    }
  }
}
.c999 {
  color: #999;
}
.ml30 {
  margin-left: 30px;
}

.line36 {
  line-height: 36px;
}
.bd1 {
  border: 1px solid #e6e6e6;
}
.mt30 {
  margin-top: 30px;
}
.c333 {
  color: #333;
}
.fl {
  float: left;
  display: inline;
}
.c999 {
  color: #999;
}
.f14 {
  font-size: 14px;
}
.mt10 {
  margin-top: 10px;
}
.c333 {
  color: #333;
}
.f18 {
  font-size: 18px;
}
.mr20 {
  margin-right: 20px;
}
.gap {
  width: 100%;
  height: 10px;
  background: #eeeeee;
}
.storeList {
  display: flex;
  border-bottom: 2px dashed #666;
  padding-bottom: 20px;
  > div {
    &:nth-child(4) {
      cursor: pointer;
    }
  }
}
.storeBtn {
  margin-top: 90px !important;
  padding-bottom: 30px;
  float: right;
  > div {
    width: 144px;
    height: 35px;
    cursor: pointer;
    text-align: center;
    line-height: 35px;
    color: #fff !important;
    float: right;
    &:nth-child(1) {
      background-color: #ff9602;
    }
    &:nth-child(2) {
      background-color: #4448f8;
      margin-right: 0 !important;
    }
  }
}
.csas {
  display: flex;
}
.help {
  width: 222px;
  margin-left: 15px;
  padding: 15px;
  > p {
    margin: 10px 0;
    font-size: 12px;
    color: #333;
    line-height: 15px;
    &:nth-child(1) {
      font-size: 14px;
      color: #666;
    }
  }
  > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    > div {
      &:nth-child(1) {
        > p {
          &:nth-child(1) {
            color: #ff0000;
          }
          &:nth-child(2) {
            font-size: 16px;
            color: #666;
          }
        }
      }
    }
  }
}
</style>
